<template>
  <div class="home">
    <el-card class="box-card">
      <div class="home_left">
        <el-col class="menu" :span="12">
          <h3>工作菜单</h3>
          <el-menu default-active="1" class="el-menu-vertical-demo menuitem">
            <el-menu-item
              @click="push_to(item.path)"
              v-for="(item, i) in menu"
              :key="i"
            >
              <i :class="item.icon"></i>
              <span slot="title">{{ item.text }}</span>
            </el-menu-item>
          </el-menu>
        </el-col>
      </div>
      <div class="home_right">
        <router-view />
      </div>
    </el-card>
  </div>
</template>
<script>
export default {
  data() {
    return {
      menu: [
        {
          text: '员工管理',
          path: '/EmpManage',
          icon: 'el-icon-user-solid',
        },
        {
          text: '客户管理',
          path: '/CustManage',
          icon: 'el-icon-warning',
        },
        {
          text: '供应商管理',
          path: '/SupplierManage',
          icon: 'el-icon-s-help',
        },
        {
          text: '采购单管理',
          path: '/PurchaseManage',
          icon: 'el-icon-bell',
        },
        {
          text: '进仓验货单管理',
          path: '/CheckfreightManage',
          icon: 'el-icon-s-order',
        },
        {
          text: '进仓单管理',
          path: '/StoreinManage',
          icon: 'el-icon-s-opportunity',
        },
        {
          text: '客诉单管理',
          path: '/KesuManage',
          icon: 'el-icon-s-flag',
        },
        {
          text: '销售确认书管理',
          path: '/SellManage',
          icon: 'el-icon-s-finance',
        },
        {
          text: '出仓单管理',
          path: '/StoreoutManage',
          icon: 'el-icon-help',
        },
        {
          text: '商品管理',
          path: '/ProductManage',
          icon: 'el-icon-goods',
        },
        {
          text: '仓库管理',
          path: '/InventoryManage',
          icon: 'el-icon-s-shop',
        },
      ],
    }
  },
  methods: {
    push_to(path) {
      this.$router.push('/home' + path)
    },
  },
}
</script>
<style scoped>
.home {
  margin: 5px 10px;
  width: 100%;
  height: 100%;
}
.body {
  margin: 10px 20px;
}
.home_left,
.home_right {
  float: left;
  height: 100%;
}
.home_left {
  width: 16%;
}
.home_right {
  width: 82%;
}
.menu,
.menuitem {
  width: 100%;
  height: 100%;
}
.box-card {
  min-height: 100%;
  height: 100%;
}
.box-card >>> .el-card__body {
  height: 100%;
}
</style>
